﻿@inherits BV.PACS.WEB.Client.Materials.BatchContentTemplatePanelCode


<EditForm Model="@TemplatesViewModel" OnValidSubmit="@HandleValidSubmit" OnInvalidSubmit="@HandleInvalidSubmit" Context="EditFormContext">
    <DataAnnotationsValidator/>
    <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
        <DxFormLayoutItem Context="InnerFormContext" ColSpanLg="10" ColSpanMd="10">
            <Template>
                <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
                    <DxFormLayoutItem Caption="@Translations.SourceTemplate" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxComboBox Data="@SourceTemplates"
                                        TextFieldName="Name"
                                        NullText="@PacsMessagesTranslations.SelectTemplate"
                                        @bind-SelectedItem="@TemplatesViewModel.SourceTemplate">
                            </DxComboBox>
                            <ValidationMessage For="@(() => TemplatesViewModel.SourceTemplate)"/>
                        </Template>
                    </DxFormLayoutItem>
                    <DxFormLayoutItem Caption="@Translations.MaterialTemplate" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxComboBox Data="@MaterialTemplates"
                                        TextFieldName="Name"
                                        NullText="@PacsMessagesTranslations.SelectTemplate"
                                        @bind-SelectedItem="@TemplatesViewModel.MaterialTemplate">
                            </DxComboBox>
                            <ValidationMessage For="@(() => TemplatesViewModel.MaterialTemplate)"/>
                        </Template>
                    </DxFormLayoutItem>
                    <DxFormLayoutItem Caption="@Translations.AliquotTemplate" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxComboBox Data="@AliquotTemplates"
                                        TextFieldName="Name"
                                        NullText="@PacsMessagesTranslations.SelectTemplate"
                                        @bind-SelectedItem="@TemplatesViewModel.AliquotTemplate">
                            </DxComboBox>
                            <ValidationMessage For="@(() => TemplatesViewModel.AliquotTemplate)"/>
                        </Template>
                    </DxFormLayoutItem>
                    <DxFormLayoutItem Caption="@Translations.Sources" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxSpinEdit @bind-Value="@TemplatesViewModel.SourceCount"></DxSpinEdit>
                            <ValidationMessage For="@(() => TemplatesViewModel.SourceCount)"/>
                        </Template>
                    </DxFormLayoutItem>
                    <DxFormLayoutItem Caption="@Translations.Materials" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxSpinEdit @bind-Value="@TemplatesViewModel.MaterialCount"></DxSpinEdit>
                            <ValidationMessage For="@(() => TemplatesViewModel.MaterialCount)"/>
                        </Template>
                    </DxFormLayoutItem>
                    <DxFormLayoutItem Caption="@Translations.Aliquots" ColSpanLg="4" ColSpanMd="6">
                        <Template>
                            <DxSpinEdit @bind-Value="@TemplatesViewModel.AliquotCount"></DxSpinEdit>
                            <ValidationMessage For="@(() => TemplatesViewModel.AliquotCount)"/>
                        </Template>
                    </DxFormLayoutItem>
                </DxFormLayout>
            </Template>
        </DxFormLayoutItem>

        <DxFormLayoutItem Context="ButtonContext" ColSpanLg="2" ColSpanMd="2">
            <Template>
                <DxFormLayout CaptionPosition="@CaptionPosition.Vertical">
                    <DxFormLayoutItem ColSpanLg="12" ColSpanMd="12">
                        <Template>
                            <button type="submit" class="btn btn-primary btn-block" style="margin-top: 80px;">@Translations.Generate</button>
                        </Template>
                    </DxFormLayoutItem>

                </DxFormLayout>
            </Template>
        </DxFormLayoutItem>

    </DxFormLayout>
</EditForm>